from pydantic import BaseModel
from typing import Optional
from uuid import UUID
from datetime import datetime


class EvaluationTemplateCreate(BaseModel):
    template_version_code: str
    name: str
    indicator_version_id: Optional[str] = None
    word_template_mongo_id: Optional[str] = None


class EvaluationTemplateUpdate(BaseModel):
    template_version_code: Optional[str] = None
    name: Optional[str] = None
    indicator_version_id: Optional[str] = None
    word_template_mongo_id: Optional[str] = None


class EvaluationTemplateRead(BaseModel):
    id: UUID
    template_version_code: str
    name: str
    indicator_version_id: Optional[UUID] = None
    word_template_mongo_id: Optional[str] = None
    created_at: Optional[datetime] = None
    updated_at: Optional[datetime] = None

    class Config:
        from_attributes = True